#! /usr/bin/python

def GetUniqueWords(text):
  list= text.split()
  my_dict= dict()
  unique= []

  for item in list:
    item= item.lower()
    item= item.replace('!', '').replace('-', '').replace('(', '').replace(')', '').replace('.', '').replace (',','').replace('?', '').replace(':','').replace(';','').replace('','')

    print item
    if (item in my_dict):
      my_dict[item]+= 1
    else:
      my_dict[item]=1

  for key in my_dict.iterkeys():
    if (my_dict[key]==1):
      unique.append (key)

  return unique

def main():
  # Open the file, read it into memory as a single string.
  with open('alice_in_wonderland.txt') as alice_file:
    alice_text = alice_file.read()
  GetUniqueWords(alice_text)
  #print 'Unique words:', GetUniqueWords(alice_text)

if __name__ == '__main__':
  main()
